export default function findNodeById (tree: API.Node[], id: string): API.Node | undefined {
  const node: API.Node | undefined = tree.find ? tree.find((item) => item.id === id) : undefined;
  if (node) return node;
  for (let i = 0; i < tree.length; i++) {
    const item = tree[i];
    if (item.children) {
      let node = findNodeById(item.children, id)
      if (node) return node;
    };
  }
}